﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Esign.Net.Output
{
    [Serializable]
    public class Files
    {
        [Serializable]
        public class Verify
        {
            [JsonProperty("signInfos")]
            public IList<SignInfo> SignInfos { get; set; }
        }

        /// <summary>
        /// 数字证书信息
        /// </summary>
        [Serializable]
        public class Cert
        {
            [JsonProperty("certBase64")]
            public string CertBase64 { get; set; }

            [JsonProperty("certOwner")]
            public string CertOwner { get; set; }

            [JsonProperty("certSN")]
            public string CertSN { get; set; }

            [JsonProperty("effectiveTime")]
            public string EffectiveTime { get; set; }

            [JsonProperty("expireTime")]
            public string ExpireTime { get; set; }

            [JsonProperty("issuerCN")]
            public string IssuerCN { get; set; }
        }

        /// <summary>
        /// 签名信息
        /// </summary>
        [Serializable]
        public class Signature
        {
            [JsonProperty("modify")]
            public bool Modify { get; set; }

            [JsonProperty("signTime")]
            public string SignTime { get; set; }

            [JsonProperty("signTimeSource")]
            public string SignTimeSource { get; set; }
        }

        /// <summary>
        /// PDF文件中签署信息
        /// </summary>
        [Serializable]
        public class SignInfo
        {

            [JsonProperty("cert")]
            public Cert Cert { get; set; }

            [JsonProperty("sealData")]
            public string SealData { get; set; }

            [JsonProperty("signature")]
            public Signature Signature { get; set; }
        }

        /// <summary>
        /// 通过模版创建合同文件
        /// </summary>
        [Serializable]
        public class CreateFileByDocTemplateId
        {

            [JsonProperty("fileDownloadUrl")]
            public string FileDownloadUrl { get; set; }

            /// <summary>
            /// 合同文件id
            /// </summary>
            [JsonProperty("fileId")]
            public string FileId { get; set; }
        }
    }

}
